package com.sgq.vue.config;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @author: 83778
 * @date: 2023-12-23 19:58
 * @desc:
 */
@Configuration
@PropertySource(value = {"classpath:application.yml"}, encoding = "UTF-8")//读取配置文件
@ConfigurationProperties(prefix="sgq.weather")//读取节点
public class WeatherProperties implements InitializingBean {

    @Value("${appid}")
    private String appid;

    @Value("${appsecret}")
    private String appsecret;

    public static String APP_ID;

    public static String APP_SECRET;

    @Override
    public void afterPropertiesSet() throws Exception {
        APP_ID = appid;
        APP_SECRET = appsecret;
    }
}
